# Makefile.in for lacheck  -- S Rahtz s.rahtz@elsevier.co.uk.  Public domain.
# Remember to change when lacheck is updated.
REV = 1.26
version = 1.0
kpse_include ../make/paths.mk
kpse_include ../make/common.mk
kpse_include ../make/programs.mk

LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@

prog_cflags = -DUNIX  -DNeedFunctionPrototypes

program = lacheck
objects = $(LEX_OUTPUT_ROOT).o

programs = $(program)

default: $(program)
all: $(program)

$(program): $(objects) 
	$(kpathsea_link) $(objects) $(LEXLIB)

install: install-exec install-data

uninstall: uninstall-exec uninstall-data

install-exec: all
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
uninstall-exec:
	for p in $(programs); do rm -f $(bindir)/$$p; done

install-data: lacheck.1
	$(SHELL) $(top_srcdir)/../mkinstalldirs  $(man1dir)
	$(INSTALL_DATA) lacheck.1 $(man1dir)/lacheck.1

uninstall-data: 
	rm -f $(man1dir)/lacheck.1

lacheck.1: 	lacheck.man  
	-sed -e "s!%%LACHECKREV%%!Release $(REV)!" $(srcdir)/lacheck.man |\
	sed -e "s!%%LACHECKDATE%%!`date +%D`!" |\
	sed -e "s!%%LACHECKPATH%%!lacheck!" > $@ 

kpse_include ../make/dist.mk
kpse_include ../make/config.mk

check info dvi:

kpse_include ../make/clean.mk

clean::
	rm -f $(LEX_OUTPUT_ROOT).c lacheck.1

$(LEX_OUTPUT_ROOT).c: lacheck.lex
	$(LEX) $(srcdir)/lacheck.lex

kpse_include ../make/rdepend.mk
kpse_include depend.mk
